﻿using System;
using System.Text;
using System.Windows.Forms;

namespace System
{
    public class ClipBoardHelper
    {
        /// <summary>
        /// Get Text in ClipBoard
        /// </summary>
        /// <returns>text in ClipBoard, 
        /// empty String if no text is in it</returns>
        /// <example>
        /// string text = ClipBoardHelper.GetText();
        /// </example>
        public static string GetText()
        {
            IDataObject dataObj = Clipboard.GetDataObject();

            if( !dataObj.GetDataPresent(DataFormats.Text) )
                return "";

            return dataObj.GetData(DataFormats.Text).ToString();

        }
    }
}